package me.zhengjie.modules.system.domain.vo;

import com.allwees.bs.core.modelbase.constant.ErrorMessage;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResetPassword {

    @NotBlank(message = ErrorMessage.PARAM_NOT_NULL,groups = {Step1.class,Step2.class})
    private String email;

    @NotBlank(message = ErrorMessage.PARAM_NOT_NULL,groups = Step2.class)
    @Pattern(regexp = "^(?![A-Za-z]+$)(?!\\d+$)(?![\\W_]+$)\\S{8,16}$", message = "密码的组成至少要包括大小写字母、数字及标点符号的其中两项")
    private String password;

    public interface Step1{}
    public interface Step2{}
}
